# Required fxn: 'cluster1 est' # elements: mi, income (response): yi, rent (y/n): ai mi=c(8,12,4,5,6,6,7,5,8,3,2,6,5,10,9,3,6,5,5,4,6,8,7,3,8) yi=c(96000,121000,42000,65000,52000,40000,75000,65000,45000,50000,85000,43000,54000,49000,53000, 50000,32000,22000,45000,37000,51000,30000,39000,47000,41000) ai=c(4,7,1,3,3,4,4,2,3,2,1,3,2,5,4,1,4,2,3,1,3,3,4,0,3) N=415 # estimate mean and total with known M M=2500 # mean c1.est('income',yi,mi,M,N,'mean') c1.est('income',yi,mi,M,N,'total') # estimate mean and total with unknown M c1.est('income',yi,mi,M=NULL,N,'mean') c1.est('income',yi,mi,M=NULL,N,'total') # estimate proportion c1.est('rent',ai,mi,M=NULL,N,'proportion')